<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html" charset="utf-8"><!--用于http传输-->
    <title>首页</title>
    <link rel="stylesheet"  href="http://libs.baidu.com/bootstrap/2.3.2/css/bootstrap.css">
    <script type="text/javascript" src="http://libs.baidu.com/jquery/2.3.2/jquery.js"></script>
    <script type="text/javascript" src="http://libs.baidu.com/bootstrap/2.3.2/js/bootstrap.js"></script>
</head>
<body>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span10">
            <h3 class="text-center">
                NewsDemo
            </h3>
        </div>
        <div class="span2">
            <h4 class="text-center">
                <a href="/User/Login" th:if="${session.loginUser}==null">登录</a>
                <a id="user" th:if="${session.loginUser}" th:text="${session.loginUser.username}" ></a>
                <a th:if="${session.loginUser}" href="/User/logout"}>退出登陆</a>
            </h4>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span2">
        </div>
        <div class="span6">
            <form class="form-search" action="/TitleView/search" style="display: inline-block">
                <input class="input-medium search-query" type="text" name="word" /> <button type="submit" class="btn">分词查找</button>
            </form>
            <form class="form-search" action="/TitleView/searchByLike" style="display: inline-block">
                <input class="input-medium search-query" type="text" name="word" /> <button type="submit" class="btn">LIKE查找</button>
            </form>
            <ul th:each="article:${article}">
                <a th:href="@{'/ContentView/getOne?id='+${article.id}}"><li th:text="${article.title}"/></a>
            </ul>
        </div>
        <div class="span4">
            <h3>
                推荐新闻
            </h3>
            <ul th:each="randomList:${randomList}">
                <a th:href="@{'/ContentView/getOne?id='+${randomList.id}}"><li th:text="${randomList.title}"/></a>
            </ul>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
        </div>
    </div>
</div>
</body>
</html>